package cn.chenhuanming.shh.administer.entity.jpa;

import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Store entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "store", catalog = "house")
public class Store implements java.io.Serializable {

	// Fields

	private Integer id;
	private UserBroker userBroker;
	private String applyReason;
	private String applyName;
	private LocalDateTime applyTime;
	private String name;
	private String photo;
	private String introduction;
	private String examineStatus;
	private String examineName;
	private LocalDateTime examineTime;
	private String status;
	private Set<House> houses = new HashSet<House>(0);

	// Constructors

	/** default constructor */
	public Store() {
	}

	/** minimal constructor */
	public Store(UserBroker userBroker, String applyReason, String applyName,
			LocalDateTime applyTime, String examineStatus, String status) {
		this.userBroker = userBroker;
		this.applyReason = applyReason;
		this.applyName = applyName;
		this.applyTime = applyTime;
		this.examineStatus = examineStatus;
		this.status = status;
	}

	/** full constructor */
	public Store(UserBroker userBroker, String applyReason, String applyName,
			LocalDateTime applyTime, String name, String photo,
			String introduction, String examineStatus, String examineName,
			LocalDateTime examineTime, String status, Set<House> houses) {
		this.userBroker = userBroker;
		this.applyReason = applyReason;
		this.applyName = applyName;
		this.applyTime = applyTime;
		this.name = name;
		this.photo = photo;
		this.introduction = introduction;
		this.examineStatus = examineStatus;
		this.examineName = examineName;
		this.examineTime = examineTime;
		this.status = status;
		this.houses = houses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "apply_id", nullable = false)
	public UserBroker getUserBroker() {
		return this.userBroker;
	}

	public void setUserBroker(UserBroker userBroker) {
		this.userBroker = userBroker;
	}

	@Column(name = "apply_reason", nullable = false, length = 65535)
	public String getApplyReason() {
		return this.applyReason;
	}

	public void setApplyReason(String applyReason) {
		this.applyReason = applyReason;
	}

	@Column(name = "apply_name", nullable = false, length = 20)
	public String getApplyName() {
		return this.applyName;
	}

	public void setApplyName(String applyName) {
		this.applyName = applyName;
	}

	@Column(name = "apply_time", nullable = false, length = 19)
	public LocalDateTime getApplyTime() {
		return this.applyTime;
	}

	public void setApplyTime(LocalDateTime applyTime) {
		this.applyTime = applyTime;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "photo")
	public String getPhoto() {
		return this.photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Column(name = "introduction", length = 65535)
	public String getIntroduction() {
		return this.introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	@Column(name = "examine_status", nullable = false, length = 4)
	public String getExamineStatus() {
		return this.examineStatus;
	}

	public void setExamineStatus(String examineStatus) {
		this.examineStatus = examineStatus;
	}

	@Column(name = "examine_name", length = 20)
	public String getExamineName() {
		return this.examineName;
	}

	public void setExamineName(String examineName) {
		this.examineName = examineName;
	}

	@Column(name = "examine_time", length = 19)
	public LocalDateTime getExamineTime() {
		return this.examineTime;
	}

	public void setExamineTime(LocalDateTime examineTime) {
		this.examineTime = examineTime;
	}

	@Column(name = "status", nullable = false, length = 3)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "store")
	public Set<House> getHouses() {
		return this.houses;
	}

	public void setHouses(Set<House> houses) {
		this.houses = houses;
	}

}